Skip to content

Translate pointer to data member - #621

Merged
nunoplopes merged 17 commits into
Cpp2Rust:masterfrom
lucic71:expr.mptr
Nov 16, 2026
Merged

nunoplopes merged 17 commits into
Cpp2Rust:masterfrom
lucic71:expr.mptr

Conversation

@lucic71

@lucic71 lucic71 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Translate pointer to data member as an isize offset into the struct. Also add tests for all pointers to member (data member, function member, inheritance) (#619).

Only data members are translated, function members and inheritance tests are still failing.

@lucic71
lucic71 marked this pull request as draft November 16, 2026 17:10
@lucic71
lucic71 marked this pull request as ready for review November 16, 2026 17:16

std::string
ConverterRefCount::GetFieldOffsetAsString(const clang::FieldDecl *field) {
return std::format("<{} as Record>::OFFSETS.{}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is super ugly. Should be hidden in a macro

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nunoplopes

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@lucic71
lucic71 marked this pull request as draft November 16, 2026 21:28
@lucic71
lucic71 marked this pull request as ready for review November 16, 2026 21:30
@nunoplopes
nunoplopes merged commit 6054d0c into Cpp2Rust:master Nov 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants